/* eslint-disable */
import {
	hiprint
} from 'vue-plugin-hiprint'

// 自定义设计元素1
export const aProvider = function(ops) {
	var addElementTypes = function(context) {
		context.removePrintElementTypes("dProviderModule");
		context.addPrintElementTypes(
			"dProviderModule",
			[
				new hiprint.PrintElementTypeGroup("模板", [{
						tid: 'dProviderModule.numbers',
						title: '单号',
						data: '单号',
						type: 'text',
						options: {
							field: 'numbers',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							hideTitle: false
						}
					},
					{
						tid: 'dProviderModule.proData',
						title: '制单日期',
						data: '制单日期',
						type: 'text',
						options: {
							field: 'proData',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							hideTitle: false
						}
					},
					{
						tid: 'dProviderModule.busData',
						title: '业务日期',
						data: '业务日期',
						type: 'text',
						options: {
							field: 'busData',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "left",
							textContentVerticalAlign: "middle"
						}
					},
					{
						tid: 'dProviderModule.unit',
						title: '我方单位',
						data: '我方单位',
						type: 'text',
						options: {
							field: 'unit',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "left",
							textContentVerticalAlign: "middle"
						}
					},
					{
						tid: 'dProviderModule.plate',
						title: '所属板块',
						data: '所属板块',
						type: 'text',
						options: {
							field: 'plate',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							textContentVerticalAlign: "middle",

						}
					},
					{
						tid: 'dProviderModule.outWare',
						title: '调出仓库',
						data: '调出仓库',
						type: 'text',
						options: {
							field: 'outWare',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "left",
							textContentVerticalAlign: "middle",

						}
					},
					{
						tid: 'dProviderModule.inWare',
						title: '调入仓库',
						data: '调入仓库',
						type: 'text',
						options: {
							field: 'inWare',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'dProviderModule.tranWeight',
						title: '调拨重量',
						data: '调拨重量',
						type: 'text',
						options: {
							field: 'tranWeight',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'dProviderModule.tranFee',
						title: '移库费',
						data: '移库费',
						type: 'text',
						options: {
							field: 'tranFee',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'dProviderModule.salesman',
						title: '业务员',
						data: '业务员',
						type: 'text',
						options: {
							field: 'salesman',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'dProviderModule.prepared',
						title: '制单人',
						data: '制单人',
						type: 'text',
						options: {
							field: 'prepared',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'dProviderModule.remarks',
						title: '备注',
						data: '备注',
						type: 'text',
						options: {
							field: 'remarks',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					
					{
						tid: 'dProviderModule.details',
						title: '商品明细',
						type: 'table',
						options: {
							field: 'details',
							tableHeaderRepeat: 'first',
							tableFooterRepeat: 'last',
							fields: [{
									text: '厂家',
									field: 'CJ'
								},
								{
									text: '品名',
									field: 'PM'
								},
								{
									text: '材质',
									field: 'CZ'
								},
								{
									text: '规格(mm)',
									field: 'GU'
								},
								{
									text: '尺寸(mn)',
									field: 'CH'
								},
								{
									text: '数量',
									field: 'SL'
								},
								{
									text: '单位',
									field: 'DW'
								},
								{
									text: '计重方式',
									field: 'JZFS'
								},
								{
									text: '调拨重量',
									field: 'ZL'
								},
								{
									text: '码单明细',
									field: 'MX'
								},
								{
									text: '成品号',
									field: 'CPH'
								},
								
								{
									text: '备注',
									field: 'BZ'
								},
							],
						},
						editable: true,
						columnDisplayEditable: true, //列显示是否能编辑
						columnDisplayIndexEditable: true, //列顺序显示是否能编辑
						columnTitleEditable: true, //列标题是否能编辑
						columnResizable: true, //列宽是否能调整
						columnAlignEditable: true, //列对齐是否调整
						isEnableEditField: true, //编辑字段
						isEnableContextMenu: true, //开启右键菜单 默认true
						isEnableInsertRow: true, //插入行
						isEnableDeleteRow: true, //删除行
						isEnableInsertColumn: true, //插入列
						isEnableDeleteColumn: true, //删除列
						isEnableMergeCell: true, //合并单元格
						columns: [
							[{
									title: '厂家',
									align: 'center',
									field: 'CJ',
									width: 150
								},
								{
									title: '品名',
									align: 'center',
									field: 'PM',
									width: 150
								},
								{
									title: '材质',
									align: 'center',
									field: 'CZ',
									width: 150
								},
								{
									title: '规格(mm)',
									align: 'center',
									field: 'GU',
									width: 150
								},
								{
									title: '尺寸(mn)',
									align: 'center',
									field: 'CH',
									width: 150
								},
								{
									title: '数量',
									align: 'center',
									field: 'SL',
									width: 150
								},
								{
									title: '单位',
									align: 'center',
									field: 'DW',
									width: 150
								},
								{
									title: '计重方式',
									align: 'center',
									field: 'JZFS',
									width: 150
								},
								{
									title: '调拨重量',
									align: 'center',
									field: 'ZL',
									width: 150
								},
								{
									title: '码单明细',
									align: 'center',
									field: 'MX',
									width: 150
								},
								
								{
									title: '成品号',
									align: 'center',
									field: 'CPH',
									width: 150
								},
								{
									title: '备注',
									align: 'center',
									field: 'BZ',
									width: 150
								},

							],
						],
						footerFormatter: function(options, rows, data, currentPageGridRowsData) {
							if (data && data['totalCap']) {
								return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>`
							}
							return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>'
						},
					},
				]),
				new hiprint.PrintElementTypeGroup("拖拽列表", [{
						tid: 'dProviderModule.text',
						title: '文本',
						data: '李四',
						type: 'text',
						options: {
							field: 'text',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "left",
							textContentVerticalAlign: "middle"
						}
					},
					{
						tid: 'dProviderModule.longText',
						title: '长文',
						data: '处处充满创造性',
						type: 'text',
						options: {
							field: 'longText',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "left",
							textContentVerticalAlign: "middle"
						}
					},

				]),

				new hiprint.PrintElementTypeGroup("辅助", [{
						tid: 'dProviderModule.hline',
						title: '横线',
						type: 'hline'
					},
					{
						tid: 'dProviderModule.vline',
						title: '竖线',
						type: 'vline'
					},
					{
						tid: 'dProviderModule.rect',
						title: '矩形',
						type: 'rect'
					},
					{
						tid: 'dProviderModule.oval',
						title: '椭圆',
						type: 'oval'
					}
				])
			]
		);
	};
	return {
		addElementTypes: addElementTypes
	};
};



export default 
[{
	value: 'dProviderModule',
	f: aProvider()
}]

